<?php

require_once 'database_engine/command_builders/update_command.php';

abstract class DataSourceMetadata
{
    public abstract function GetSourceSql();

    public abstract function GetFieldNames();

    /**
     * @abstract
     * @return ICommand
     */
    public abstract function CreateUpdateCommand();
}

class TableMetadata extends DataSourceMetadata
{
    /** @var string */
    private $tableName;

    /** @var string[] */
    private $fieldNames;

    /**
     * @param string $tableName
     * @param array $fieldDescArray
     */
    public function __construct($tableName, $fieldDescArray)
    {
        $this->tableName = $tableName;
        $this->fieldNames = array();
        foreach($fieldDescArray as $fieldName => $fieldDesc)
            $this->fieldNames[] = $fieldName;
    }

    public function GetSourceSql()
    {
        return $this->tableName;
    }

    public function GetFieldNames()
    {
        return $this->fieldNames;
    }

    /**
     * @abstract
     * @return ICommand
     */
    public function CreateUpdateCommand()
    {
        $commandBuilder = new UpdateCommandBuilder();
        $result = new Command();
    }
}


?>